package com.example.wan1.greenDao.db;

import java.util.Map;

import org.greenrobot.greendao.AbstractDao;
import org.greenrobot.greendao.AbstractDaoSession;
import org.greenrobot.greendao.database.Database;
import org.greenrobot.greendao.identityscope.IdentityScopeType;
import org.greenrobot.greendao.internal.DaoConfig;

import com.example.wan1.dao.HistorySearchDao;
import com.example.wan1.model.UserBean;

import com.example.wan1.greenDao.db.HistorySearchDaoDao;
import com.example.wan1.greenDao.db.UserBeanDao;

// THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT.

/**
 * {@inheritDoc}
 * 
 * @see org.greenrobot.greendao.AbstractDaoSession
 */
public class DaoSession extends AbstractDaoSession {

    private final DaoConfig historySearchDaoDaoConfig;
    private final DaoConfig userBeanDaoConfig;

    private final HistorySearchDaoDao historySearchDaoDao;
    private final UserBeanDao userBeanDao;

    public DaoSession(Database db, IdentityScopeType type, Map<Class<? extends AbstractDao<?, ?>>, DaoConfig>
            daoConfigMap) {
        super(db);

        historySearchDaoDaoConfig = daoConfigMap.get(HistorySearchDaoDao.class).clone();
        historySearchDaoDaoConfig.initIdentityScope(type);

        userBeanDaoConfig = daoConfigMap.get(UserBeanDao.class).clone();
        userBeanDaoConfig.initIdentityScope(type);

        historySearchDaoDao = new HistorySearchDaoDao(historySearchDaoDaoConfig, this);
        userBeanDao = new UserBeanDao(userBeanDaoConfig, this);

        registerDao(HistorySearchDao.class, historySearchDaoDao);
        registerDao(UserBean.class, userBeanDao);
    }
    
    public void clear() {
        historySearchDaoDaoConfig.clearIdentityScope();
        userBeanDaoConfig.clearIdentityScope();
    }

    public HistorySearchDaoDao getHistorySearchDaoDao() {
        return historySearchDaoDao;
    }

    public UserBeanDao getUserBeanDao() {
        return userBeanDao;
    }

}
